knitr::opts_chunk$set(echo = TRUE)

Model fitting

Under the structure of Bass-SIR model, we provide three models in the family for fitting

Load the package as a starter

library(BassSIR)

Input data

We use the data of COVID-19 in Hubei as an example

cases <- as_bass_data(n_covid19$Hubei, id = "Hubei")

Fitting and summarising

est1 <- BassSIR::fit(cases, r_rec = 1/22.2, r_death = 1/22.3, type = "BassSIR")
est2  <- BassSIR::fit(cases, r_rec = 1/22.2, r_death = 1/22.3, type = "SIR")
est3  <- BassSIR::fit(cases, r_rec = 1/22.2, r_death = 1/22.3, type = "Growth")
summary(est1)
summary(est2)
summary(est3)

Model comparison

compare_models(BassSIR = est1, SIR = est2, Growth = est3)


COVID-19-Modelling/BassSIR documentation built on April 20, 2020, 1:57 a.m.